
<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>.: Portal Kerjaya :.</title>
        <link type="text/css" href="${pageContext.request.contextPath}/pub/style/cupertino/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
        <script type="text/javascript" src="${pageContext.request.contextPath}/pub/js/jquery-ui-1.8.16.custom.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $("form").submit(function() {
                    return formValidation();
                });
            });

            function test(f) {
                $(f).clearForm();
            }

            function check(f) {

                if(document.form1.idPengguna.value.length == 0){
                    alert("Sila masukkan ID Pengguna");
                    form1.idPengguna.focus();
                    return (false);
                }
                if(document.form1.nama.value.length == 0){
                    alert("Sila masukkan Nama");
                    form1.nama.focus();
                    return (false);
                }
                str1 = f.password.value;
                str2 = f.repassword.value;
                if(document.form1.password.value.length == 0){
                    alert("Sila masukkan Kata Laluan");
                    form1.password.focus();
                    return (false);
                }
                if (str1.length < 6) {
                    alert("Kata Laluan tidak boleh kurang dari 6 aksara!!");
                    return false;
                }
                if (str1.length > 10) {
                    alert("Kata Laluan tidak boleh lebih dari 10 aksara!!");
                    return false;
                }
                if (str1 != str2) {
                    alert("Kata Laluan dan Pengesahan Kata Laluan tidak sama!!");
                    return false;
                }
                return confirm("Click on OK to confirm");
            }

            function removePguna (val) {
                form = document.form1;
                var answer = confirm("adakah anda pasti untuk Hapus?");
                if (answer) {
                    form.action = '${pageContext.request.contextPath}/daftar/pengguna?deletePguna&idPengguna='+val;
                    form.submit();
                }
            }

            function popup(url)
            {
                params  = 'width='+screen.width;
                params += ', height='+screen.height;
                params += ', top=0, left=0'
                params += ', fullscreen=yes';
                params += ', directories=no';
                params += ', location=no';
                params += ', menubar=no';
                params += ', resizable=no';
                params += ', scrollbars=yes';
                params += ', status=no';
                params += ', toolbar=no';
                newwin=window.open(url,'PopUp', params);
                if (window.focus) {newwin.focus()}
                return false;
            }
        </script>
    </head>
    <body>
        <s:useActionBean beanclass="com.jkoa.util.ListUtil" var="list"/>
        <s:form beanclass="com.jkoa.stripes.action.KemasukanMajikanActionBean" name="form1">
            <s:messages />
            <s:errors />
     <div class="content" align="center">
                    <div class="left_entry">
                        <table width="100%" border="0" bordercolor="#BBB">
                            <tr><th class="left_title" colspan="3">Daftar Account JKOA</th></tr>
                        <tr><td  style="text-align: right"><font color="red">*</font> ID Pengguna :</td>
                        <td>
                            <s:text name="pguna.idPengguna" style="width:250px" id="idPengguna" class="normal_text"/>
                        </td></tr>
                  <%--  <tr><td  style="text-align: right"><font color="red">*</font> Nama :</td>
                        <td>
                            <s:text name="pguna.nama" style="width:250px" id="nama" class="normal_text"/>
                        </td></tr>--%>
                    <tr><td  style="text-align: right"><font color="red">*</font> Kata Laluan :</td>
                        <td>
                            <s:password name="pguna.password" maxlength="10"  id="password" class="normal_text"/>
                        </td><td>
                            <s:button  name="save" value="Jana Kata Laluan" class="btn" onclick="jana();" /></td></tr>
                    <tr><td  style="text-align: right"><font color="red">*</font> Pengesahan Kata Laluan :</td>
                        <td>
                            <s:password  name="pKataLaluan" maxlength="10"  id="repassword" class="normal_text"/>
                        </td></tr>
                <%--    <tr><td  style="text-align: right"><font color="red">*</font> Jenis Pengguna :</td>
                        <td>
                            <s:select name="pguna.kodPguna.kod"  style="width:250px">
                                <s:option value="">Sila Pilih</s:option>
                                <s:options-collection collection="${list.senaraiKodPguna}" label="nama" value="kod"/>
                            </s:select>
                        </td></tr>--%>
                  <%--  <tr><td  style="text-align: right"><font color="red">*</font> Aktif :</td>
                        <td>
                            <s:radio name="pguna.aktif" value="Y" />Ya
                            <s:radio name="pguna.aktif" value="X" />Tidak
                        </td></tr>--%>
                    <tr><td colspan="3">
                            <div align="center">
                                <s:submit  name="savePguna" value="Simpan" class="btn fix_width" onclick="check(this.form);" />
                                <s:submit name="showForm" value="Isi Semula" class="btn fix_width" onclick="test(this.form);"/>
                            </div>
                        </td></tr>

                            <tr><td colspan="3">&nbsp;</td>
                            </tr>

                            <tr><th class="left_title" colspan="3">Maklumat Majikan</th></tr>
                            <tr><td>Nama Majikan :</td>
                                <td>
                                    <s:text name="majikan.namaMajikan"/>
                                </td></tr>
                            <tr><td><br/>Status Majikan :</td>
                                <td>
                                    <s:select name="majikan.kodSektor.kod" style="width: 100%" id="kodSektor">
                                        <s:options-collection collection="${list.senaraiSektor}" label="nama" value="kod"/>
                                    </s:select>
                                </td></tr>
                            <tr><td>No. Pengenalan Majikan:</td> <td>
                                    <s:text name="majikan.noPengenalan" />
                                    <span class="no_pengenalan"></span>
                                </td>
                            </tr>

                            <tr><td valign="top">Alamat :</td>
                                <td>
                                    <s:text name="majikan.alamatMajikan1"/>
                                    <br/>
                                    <s:text name="majikan.alamatMajikan2"/>
                                    <br/>
                                    <s:text name="majikan.alamatMajikan3"/>
                                    <br/>
                                    <s:text name="majikan.alamatMajikan4"/>
                                </td></tr>
                            <tr><td>Daerah :</td>
                                <td class="s">
                                    <s:text name="majikan.alamatDaerah"/>
                                </td></tr>
                            <tr><td>Poskod :</td>
                                <td class="s">
                                    <s:text name="majikan.alamatPoskod"/>
                                </td></tr>
                            <tr><td>Negeri :</td>
                                <td class="s">
                                   <s:select name="majikan.alamatNegeri.kod" style="width: 100%" id="alamatNegeri">
                                        <s:options-collection collection="${list.senaraiNegeri}" label="nama" value="kod"/>
                                    </s:select>
                                </td></tr>
                            <%--update table--%>
                            <tr><td>No. Telefon :</td>
                                <td class="s">
                                    <s:text name="majikan.noTel"/>
                                </td></tr>
                            <tr><td>No. Fax :</td>
                                <td class="s">
                                    <s:text name="majikan.noFax"/>
                                </td></tr>
                            <tr><td>E-mail Majikan :</td>
                                <td class="s">
                                    <s:text name="majikan.email"/>
                                </td></tr>
                            <tr><td>Laman Web :</td>
                                <td class="s">
                                    <s:text name="majikan.lamanWeb"/>
                                </td></tr>
                            <tr><td>Nama Pegawai Untuk dihubungi :</td>
                                <td class="s">
                                    <s:text name="majikan.namaPegawaiDihubungi"/>
                                </td></tr>
                            <tr><td>No. Tel. Pegawai Untuk dihubungi :</td>
                                <td class="s">
                                    <s:text name="majikan.noTelPegawaiDihubungi"/>
                                </td></tr>
                              <tr><td>Email Pegawai Untuk dihubungi :</td>
                                <td class="s">
                                    <s:text name="majikan.emailPegawaiDihubungi"/>
                                </td></tr>
                            <tr><td>Bidang  :</td>
                                <td class="s">
                                       <s:select name="majikan.kodBidang.kod" style="width: 100%" id="kodBidang">
                                        <s:options-collection collection="${list.senaraiBidang}" label="nama" value="kod"/>
                                    </s:select>
                                </td></tr>
                            <tr><td>Sub-Bidang  :</td>
                                <td class="s">
                                        <s:select name="majikan.kodSubbidang.kod" style="width: 100%" id="kodSubbidang">
                                        <s:options-collection collection="${list.senaraiSubBidang}" label="nama" value="kod"/>
                                    </s:select>
                                </td></tr>
                            <tr><td>Bilangan Pekerja :</td>
                                <td class="s">
                                    <s:text name="majikan.bilPekerja"/>
                                </td></tr>
                            <tr><td colspan="3">

                                    <div align="center">
                                        <s:submit name="simpanMajikan" value="Daftar" class="btn fix_width" />
                                        <s:button name="reset" value="Isi Semula" class="btn fix_width"/>
                                        <s:button name="test" value="sdasd" class="btn fix_width" onclick="saveMajikan()"/>
                                    </div>

                                </td></tr>
                        </table>
                    </div>
                </div>
        </s:form>
    </body>
</html>
